package com.lineage.data.npc;

import com.lineage.data.executor.NpcExecutor;
import com.lineage.server.model.Instance.L1NpcInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.L1Clan;
import com.lineage.server.serverpackets.S_NPCTalkReturn;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import com.lineage.server.world.WorldClan;

public class clan_lv extends NpcExecutor {
  public static NpcExecutor get() {
    return new clan_lv();
  }
  
  public int type() {
    return 3;
  }
  
  public void talk(L1PcInstance pc, L1NpcInstance npc) {
    L1Clan clan = WorldClan.get().getClan(pc.getClanname());
    String[] info = new String[7];
    if (pc.getClanid() == 0) {
      pc.sendPackets((ServerBasePacket)new S_SystemMessage("你没有加入血盟，是要升级三小"));
      return;
    } 
    if (pc.getClanid() > 0) {
      info[0] = String.valueOf(pc.getClanname());
    } else {
      info[0] = "无";
    } 
    if (pc.getClanid() > 0) {
      info[1] = String.valueOf(clan.getClanLevel());
    } else {
      info[1] = "无";
    } 
    if (pc.getClanid() > 0) {
      info[2] = String.valueOf(clan.getClanContribution());
    } else {
      info[2] = "无";
    } 
    info[3] = String.valueOf(pc.getPcContribution());
    info[4] = String.valueOf(pc.getClanContribution());
    info[5] = String.valueOf(pc.getclanadena());
    info[6] = String.valueOf(clan.getclanadena());
    pc.sendPackets((ServerBasePacket)new S_NPCTalkReturn(pc.getId(), "clanlvadd", info));
  }
}
